package com.sikaryofficial.information.domain.mapping;

import com.sikaryofficial.information.domain.dto.resp.ArticleRecommendDTO;
import com.sikaryofficial.information.domain.entity.Article;
import com.sikaryofficial.information.domain.entity.ArticleRecommend;
import com.sikaryofficial.system.api.model.infomation.ArticleDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 活动映射接口
 * @date : 2023/11/03 9:19
 */
@Mapper
public interface ArticleMapping {
    ArticleMapping INSTANCE = Mappers.getMapper(ArticleMapping.class);

    /**
     * 实体映射
     *
     * @param activity
     * @return
     */
    ArticleDTO coverToDTO(Article activity);

    /**
     * 实体映射
     *
     * @param activity
     * @return
     */
    List<ArticleDTO> coverToDTOList(List<Article> activity);

    /**
     * 实体映射
     *
     * @param activityReq
     * @return
     */
    Article coverToEntity(ArticleDTO activityReq);

    /**
     * 实体映射
     *
     * @param recommendDTO
     * @return
     */
    ArticleRecommend coverToEntity(ArticleRecommendDTO recommendDTO);

    /**
     * 实体映射resp
     *
     * @param activityList
     * @return
     */
    List<Article> coverToArticleList(List<ArticleDTO> activityList);

    /**
     * 实体映射
     *
     * @param activityList
     * @return
     */
    List<ArticleRecommend> coverToRecommendList(List<ArticleRecommendDTO> activityList);
}
